QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Locating a Movie's Tracks and Media Structures

GetMovieIndTrackType

The GetMovieIndTrackType function allows you to search for all of a movie's tracks that share a given media type or media characteristic.

pascal Track GetMovieIndTrackType (Movie theMovie, long index, OSType trackType, long
                     flags);
theMovie
Specifies the movie for this operation. Your application obtains this identifier from such functions as NewMovie , NewMovieFromFile , and NewMovieFromHandle .
index
Specifies the index value of the track for this operation. This is not that same as the track's index value in the movie. Rather, this parameter is an index into the set of tracks that meet your other selection criteria.
trackType
Contains either a media type or a media characteristic value. The Movie Toolbox applies this value to the search, and returns information about tracks that meet this criterion. You indicate whether you have specified a media type or characteristic value by setting the flags parameter appropriately.
flags
Contains flags that control the search operation. The following flags are valid (note that you may not set both movieTrackMediaType and movieTrackCharacteristic to 1):
movieTrackMediaType
Indicates that the trackType parameter contains a media type value. Set this flag to 1 if you are supplying a media type value (such as VideoMediaType ).
movieTrackCharacteristic
Indicates that the trackType parameter contains a media characteristic value. Set this flag to 1 if you are supplying a media characteristic value (such as VisualMediaCharacteristic ).
movieTrackEnabledOnly
Specifies that the Movie Toolbox should only search enabled tracks. Set this track to 1 to limit the search to enabled tracks.
function result
Returns the track identifier of your selected track or nil .

Description

The Movie Toolbox returns the track identifier that corresponds to the track that meets your selection criteria. If the Movie Toolbox cannot find a matching track, in returns a value of nil .

Note that the index parameter does not work the same way that is does in the GetMovieIndTrack function. With the GetMovieIndTrackType function, the index parameter specifies an index into the set of tracks that meet your other selection criteria. For example, in order to find the third track that supports the sound characteristic, you would call the function in the following manner:

theTrack = GetMovieIndTrackType (theMovie,
                     3,
                     AudioMediaCharacteristic,
                     movieTrackCharacteristic);

RESULT CODES

paramErr

-50

Invalid parameter specified

invalidMovie

-2010

The movie is corrupted or invalid


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next